import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class SoftWord {
    public static void  main(String args[]) throws IOException {
        NumLet numLet [] =new NumLet[26];
        int Number [] = new int [26];
        char Letter [] =new char[26];
        for(int i = 0;i<Letter.length;i++){
            Letter[i] = (char) (i+97);
        }
        String fileName = "C:\\Users\\HP\\Desktop\\test01\\one.txt";
//        String fileName = "C:\\Users\\HP\\Desktop\\test01\\完整测试集.txt";
        FileReader fileReader = new FileReader(fileName);
        BufferedReader bufferedReader = new BufferedReader(fileReader);
        String line = bufferedReader.readLine();
        while(line!=null){
            String enline = line.toLowerCase();
            char enlinee [] = enline.toCharArray();

          for(char enlin:enlinee){

               switch (enlin){
                   case 'a':
                       Number[0]++;
                       break;
                   case 'b':
                       Number[1]++;
                       break;
                   case 'c':
                       Number[2]++;
                       break;
                   case 'd':
                       Number[3]++;
                       break;
                   case 'e':
                       Number[4]++;
                       break;
                   case 'f':
                       Number[5]++;
                       break;
                   case 'g':
                       Number[6]++;
                       break;
                   case 'h':
                       Number[7]++;
                       break;
                   case 'i':
                       Number[8]++;
                       break;
                   case 'j':
                       Number[9]++;
                       break;
                   case 'k':
                       Number[10]++;
                       break;
                   case 'l':
                       Number[11]++;
                       break;
                   case 'm':
                       Number[12]++;
                       break;
                   case 'n':
                       Number[13]++;
                       break;
                   case 'o':
                       Number[14]++;
                       break;
                   case 'p':
                       Number[15]++;
                       break;
                   case 'q':
                       Number[16]++;
                       break;
                   case 'r':
                       Number[17]++;
                       break;
                   case 's':
                       Number[18]++;
                       break;
                   case 't':
                       Number[19]++;
                       break;
                   case 'u':
                       Number[20]++;
                       break;
                   case 'v':
                       Number[21]++;
                       break;
                   case 'w':
                       Number[22]++;
                       break;
                   case 'x':
                       Number[23]++;
                       break;
                   case 'y':
                       Number[24]++;
                       break;
                   case 'z':
                       Number[25]++;
                       break;
                       default:
                           break;
               }
           }
//            System.out.println(enline);

            line = bufferedReader.readLine();


        }
//        for(int i = 0;i<=numLet.length;i++){
//            char letter = (char) (i+97);
////            numLet[i].setLetter('a');
//
//        }
        int number  =0;
        double number001 = 0.00;
        for( int i = 0;i<Number.length;i++){

           for( int k= i+1;k<Number.length;k++){
               if(Number[k]>Number[i]){
                   int tempt = Number[k];
                  Number[k]=Number[i];
                  Number[i]=tempt;
                   char leet =Letter[k];
                  Letter[k] = Letter[i];
                  Letter[i]=leet;
               }
           }

            number = Number[i]+number;


        }

        for( int i = 0;i<Number.length;i++){

            number001 = 100*(double) Number[i]/(double)number;
            System.out.println(Letter[i]+"频率为："+number001+"%");
        }


//        System.out.println(bufferedReader.readLine());
//        System.out.println(0.07912734843223164+0.015170267320476466+0.020776216363000213+0.049154103109077966+0.11950741454430884+0.019951991282536004+0.02673117729281662
//        +0.0653400733534211+0.06721394515726424+0.001319456411809657+0.010836775582745409+0.04195714725864653+0.02380591805792727+0.06571867727105778
//        +0.07653804577713023+0.016561963100478867+0.0010217954007022015+0.06483526812990553+0.06204926550839979+0.08281851904073081+0.029855747555611257+0.008540782169583223
//        +0.02449349758650882+0.0012776794277945757+0.02462405066155595+0.0007728742042790075);
        bufferedReader.close();
        fileReader.close();
    }
}
